package cn.tac.test.concurrency.atomicity;

import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author : tac
 * @since : 13/08/2017
 */
@ThreadSafe
public class IsAtomic {
    public static AtomicInteger atomicInteger = new AtomicInteger(0);
    @GuardedBy("this")
    public static int intField;

    public static synchronized void syncAddInt(int val) {
        IsAtomic.intField += val;
    }
}
